<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <%-- 页头 --%>
    <title>${article.articleTitle} - ReadJava教程</title>
    <%@include file="common/head.jsp" %>
    <link rel="stylesheet" href="/resources/editor/css/editormd.css"/>

</head>
<body>
<div class="wrapper">

    <%-- 导航 --%>
    <%@include file="common/header.jsp" %>

    <%-- 侧边栏 --%>
    <div class="sidebar" style="font-weight: normal;">
        <div class="scrollbar-inner sidebar-wrapper">
            <h4 style="color: #343a40; padding: 30px; font-weight: bold;">${article.articleTitle}</h4>
            <div class="markdown-body" id="custom-toc-container"></div>
        </div>
    </div>

    <div class="main-panel">
        <div class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body">
                                <div id="test-editormd-view">
                                    <textarea name="test-editormd-markdown-doc">${article.articleContent}</textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <%-- 页脚 --%>
        <%@include file="common/footer.jsp" %>

    </div>
</div>

</body>
<%-- js --%>
<%@include file="common/script.jsp" %>
<script src="/resources/editor/lib/marked.min.js"></script>
<script src="/resources/editor/lib/prettify.min.js"></script>
<script src="/resources/editor/lib/raphael.min.js"></script>
<script src="/resources/editor/lib/underscore.min.js"></script>
<script src="/resources/editor/lib/sequence-diagram.min.js"></script>
<script src="/resources/editor/lib/flowchart.min.js"></script>
<script src="/resources/editor/lib/jquery.flowchart.min.js"></script>
<script src="/resources/editor/editormd.min.js"></script>

<script type="text/javascript">
    $(function () {
        var testEditormdView;
        testEditormdView = editormd.markdownToHTML("test-editormd-view", {
            //htmlDecode      : true,       // 开启 HTML 标签解析，为了安全性，默认不开启
            // htmlDecode: "video",  // 你可以过滤标签解码
            //toc             : false,
            tocm: true,    // Using [TOCM]
            tocContainer: "#custom-toc-container", // 自定义 ToC 容器层
            //gfm             : false,
            //tocDropdown     : true,
            // markdownSourceCode : true, // 是否保留 Markdown 源码，即是否删除保存源码的 Textarea 标签
            emoji: true,
            taskList: true,
            tex: true,  // 默认不解析
            flowChart: true,  // 默认不解析
            sequenceDiagram: true,  // 默认不解析
        });
    });
</script>
</html>